﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Chimp2D;
namespace Chimp2DExamples
{
    public class ChimpSimpleBlitting : ChimpGame
    {
        public ChimpSimpleBlitting(){
            GameInfo = "A simple blitting test to gauage engine speed.\nThis can help determine general engine speed on any given set up.";
            CopyrightInfo = "(c)public domain forever.";
            GameName = "Simple Blitting.";
        }
        ChimpImageBuffer i1;
        public override void GameStarted()
        {
   
            ChimpDraw.SetClsColor(new OpenTK.Vector4(0.0f, 1.0f, 1.0f, 1.0f));
            i1 = new ChimpImageBuffer("ShipHull1.png");
        }
        public override void GameUpdate()
        {
            
        }
     
        public override void GameRender()
        {


        
            ChimpDraw.Cls();

        //ChimpDraw.SetCol(new OpenTK.Vector4(1.0f, 0.0f, 0.0f, 0.6f));

        Random rnd = new Random(Environment.TickCount);

            ChimpDraw.BlitImage(i1, 20, 20, 200, 200);
            
            for (int i = 0; i < 500; i++)
            {
                ChimpDraw.SetCol(new OpenTK.Vector4((float)rnd.NextDouble(),(float) rnd.NextDouble(),(float) rnd.NextDouble(),(float) rnd.NextDouble()));
                ChimpDraw.BlitImage(i1,rnd.Next(0, 5), rnd.Next(0, 5), rnd.Next(5, 200), rnd.Next(5, 200));
            }

            ChimpDraw.FB.Blit();
      
        }
    }
}
